package com.loyal.loyalerp.humenresource.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.loyal.loyalerp.humenresource.user.service.GyUserService;
import com.loyal.loyalerp.mapper.GyUserMapper;
import com.loyal.loyalerp.model.GyUser;

@Service
public class GyUserServiceImpl implements GyUserService {

	@Autowired
	GyUserMapper userDao;

	@Override
	public int selectUserIdByUserName(String username) {
		return userDao.selectUserIDByusername(username);
	}

	@Override
	public GyUser selectUserByUserName(String username) {
		List<GyUser> list = userDao.selectUserByUserName(username);
		if (list != null && list.size() > 0)
			return list.get(0);
		else
			return null;
	}

	@Override
	public GyUser selectUserById(Integer id) {
		return userDao.selectByPrimaryKey(id);
	}
}
